<%@ Page Language="VB" 
    AutoEventWireup="false" 
    CodeFile="Commision.aspx.vb" 
    Inherits="Accounting_Commision" 
    MasterPageFile="~/MasterPage.master" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="divMain" runat="server">
        <table border="0" cellpadding="0" cellspacing="0" width="800">
            <tr><td style="font-size: 3px;height: 5px;"></td></tr>
        </table>
        
        <table border="0" cellpadding="0" cellspacing="0" width="800">
            <tr>
            <td align="center" style="font-weight: bold; font-size: 10pt; font-family: Arial; height: 18px;">
                <asp:LinkButton ID="Payment" runat="server" Font-Underline="False"
                    ForeColor="#0C58A2" Width="64px" PostBackUrl="~/Accounting/Payment.aspx">Payment</asp:LinkButton></td>
            <td style="font-size: 11pt; font-family: Arial; font-weight: bold; height: 18px;" align="center">
                <asp:Label ID="Label4" runat="server" ForeColor="DimGray"
                    Text="|" Width="20px"></asp:Label></td>
            <td align="center" style="font-weight: bold; font-size: 10pt; font-family: Arial; height: 18px;">
                <asp:LinkButton ID="Dispatch" runat="server" Font-Underline="False" 
                    ForeColor="#0C58A2" Width="56px" PostBackUrl="~/Accounting/Dispatch.aspx">Dispatch</asp:LinkButton></td>
            <td style="font-size: 11pt; font-family: Arial; font-weight: bold; height: 18px;" align="center">
                <asp:Label ID="Label2" runat="server" ForeColor="DimGray"
                    Text="|" Width="20px"></asp:Label></td>
            <td align="center" style="font-weight: bold; font-size: 10pt; font-family: Arial; width: 5px; height: 18px;">
                <asp:LinkButton ID="Confirmation" runat="server" Font-Underline="False" ForeColor="#0C58A2" Width="88px" PostBackUrl="~/Accounting/Confirmation.aspx">Confirmation</asp:LinkButton></td>
            <td style="font-size: 11pt; font-family: Arial; font-weight: bold; height: 18px;" align="center">
                <asp:Label ID="Label1" runat="server" ForeColor="DimGray"
                    Text="|" Width="20px"></asp:Label></td>
            <td align="center" style="font-weight: bold; font-size: 10pt; font-family: Arial; width: 137px; height: 18px;">
                <asp:LinkButton ID="Commission_Journal" runat="server" Font-Underline="False" 
                    ForeColor="Black" Width="136px">Commission Journal</asp:LinkButton></td>
            <td style="font-size: 11pt; font-family: Arial; font-weight: bold;" align="center">
                <asp:Label ID="Label3" runat="server" ForeColor="DimGray"
                    Text="|" Width="20px"></asp:Label></td>
            <td align="center" style="font-weight: bold; font-size: 10pt; font-family: Arial; width: 96px;">
                <asp:LinkButton ID="LinkButton1" runat="server" Font-Underline="False" 
                    ForeColor="#0C58A2" Width="96px" CausesValidation="False" PostBackUrl="~/Accounting/CashAdvance.aspx">Cash Advance</asp:LinkButton></td>
            <td align="left" style="font-weight: bold; font-size: 10pt; font-family: Arial; width: 246px;"></td>
            </tr>
        </table>

        <table border="0" cellpadding="0" cellspacing="0" width="800">
            <tr><td style="font-size: 3px; background-color: #105BA4; height: 3px;"></td></tr>
        </table>

        <table border="0" cellpadding="0" cellspacing="0" width="800">

        <tr><td style="width: 800px">

            <table border="0" cellpadding="0" cellspacing="0" width="800" style="height: 35px">
                <tr>
                    <td style="font-size: 10pt; font-family: Verdana; width: 97px; height: 32px;" align="left">
                        &nbsp;Start Date:</td>
                    <td align="left" style="width: 100px; height: 32px;">
                        <asp:TextBox ID="Startdate_txt" runat="server" Width="80px"></asp:TextBox></td>
                    <td style="font-size: 10pt; font-family: Verdana; width: 100px; height: 32px;" align="left">
                        &nbsp;End Date:</td>
                    <td align="left" style="width: 100px; height: 32px;">
                        <asp:TextBox ID="Enddate_txt" runat="server" Width="80px"></asp:TextBox></td>
                    <td style="font-size: 10pt; font-family: Verdana; width: 400px; height: 32px;" align="center">
                        &nbsp; &nbsp;&nbsp;
                        <!--
                        <asp:RadioButton ID="All_rb" runat="server" GroupName="Paid" Text="All Records" Checked="True" />&nbsp;
                        &nbsp;<asp:RadioButton ID="Confirm_rb" runat="server" GroupName="Paid" Text="Paid" />
                        &nbsp; &nbsp; &nbsp;&nbsp;
                        <asp:RadioButton ID="NotConfirm_rb" runat="server" GroupName="Paid" Text="Not Paid" />
                        -->
                    </td>
                        
                </tr>
            </table>
                
        </td></tr>
        
        <tr><td style="width: 800px">

            <table border="0" cellpadding="0" cellspacing="0" width="800" style="height: 35px">
                <tr>
                    <td style="font-size: 10pt; font-family: Verdana; width: 100px; height: 32px;" align="left">
                        &nbsp;Introducer:
                    </td>
                    <td align="left" style="width: 290px; height: 32px;">
                        <asp:TextBox ID="Client_txt" runat="server" Width="280px" Font-Names="Verdana"></asp:TextBox></td>
                    <td style="font-size: 10pt; font-family: Verdana; width: 90px; height: 32px;" align="left">
                        &nbsp;AR Number:</td>
                    <td align="left" style="width: 100px; height: 32px;">
                        <asp:TextBox ID="AR_txt" runat="server" Width="96px"></asp:TextBox></td>
                    <td style="font-size: 10pt; font-family: Verdana; width: 110px; height: 32px;" align="left">
                        &nbsp;Policy Number:</td>
                    <td align="left" style="width: 110px; height: 32px;">
                        <asp:TextBox ID="Policynumber_txt" runat="server" Width="100px"></asp:TextBox></td>
                </tr>
            </table>
                
        </td></tr>
        <tr><td style="width: 800px; height: 54px;">

            <table border="0" cellpadding="0" cellspacing="0" width="800" style="height: 35px">
                <tr>
                    <td style="font-size: 10pt; font-family: Verdana; width: 96px;" align="left">
                        &nbsp;Provider: &nbsp;</td>
                    <td align="left" style="width: 285px">
                        <asp:TextBox ID="Provider_txt" runat="server" Width="280px"></asp:TextBox></td>
                    <td style="font-size: 10pt; font-family: Verdana; width: 90px;" align="left">
                        &nbsp;Product:&nbsp;</td>
                    <td align="left" style="width: 315px">
                        <asp:TextBox ID="Product_txt" runat="server" Width="296px"></asp:TextBox></td>
                </tr>
            </table>
                
        </td></tr>

        <tr><td style="width: 800px">

            <table border="0" cellpadding="0" cellspacing="0" width="800" style="height: 35px">
                <tr>
                    <td style="width: 400px; height: 24px;">
                        &nbsp;<asp:CustomValidator ID="dtv1" runat="server" ClientValidationFunction="valDate"
                            ControlToValidate="Startdate_txt" ErrorMessage="Invalid Date" ForeColor="White">.</asp:CustomValidator><asp:CustomValidator
                                ID="dtv4" runat="server" ClientValidationFunction="valDate" ControlToValidate="Enddate_txt"
                                ErrorMessage="Invalid Date" ForeColor="White">.</asp:CustomValidator>
                    </td>
                    <td style="height: 24px">
                        &nbsp;</td>
                    <td style="width: 59px; height: 24px;">
                        <asp:Button ID="Save_btn" runat="server" Text="Save as Excel" BackColor="Gainsboro" Font-Names="Verdana" Width="112px" Visible="False" /></td>
                    <td style="height: 24px">
                        <asp:Button ID="Print_btn" runat="server" Text="Print Results" BackColor="Gainsboro" Font-Names="Verdana" Width="104px" Visible="False" />
                    </td>
                    <td style="height: 24px" align="right">
                        <asp:Button ID="Search_btn" runat="server" Text="Search" BackColor="Gainsboro" Font-Names="Verdana" />
                        &nbsp; &nbsp; &nbsp;
                    </td>
                </tr>
            </table>
                
        </td></tr>

        </table>

        <table border="0" cellpadding="0" cellspacing="0" width="800">
            <tr><td style="font-size: 3px; background-color: #c0c0c0; height: 3px;"></td></tr>
        </table>

        <table border="0" cellpadding="0" cellspacing="0" width="800">
            <tr><td style="font-size: 3px; height: 20px;"></td></tr>
        </table>

        <table cellpadding="0" cellspacing="0" width="800px" style="font-family:Verdana; font-size:10pt">
            <tr>
            <td align="left" style="height: 16px"> Search Results: <asp:Label ID="results_label" runat="server" Text="0"></asp:Label></td>
            <td align="right" style="height: 16px; width: 550px;"> &nbsp; &nbsp;
                &nbsp; &nbsp; </td>
            </tr>
        </table>
        
        <table cellpadding="0" cellspacing="0" width="800px" style="font-family:Verdana; font-size:3pt; height:3px">
            <tr><td>&nbsp;</td></tr>
        </table>        
        
        <table cellpadding="0" cellspacing="0">
            <tr><td style="width: 800px;">
                <asp:DataGrid ID="DataGrid" runat="server" AllowPaging="True" AllowSorting="True"
                    AutoGenerateColumns="False" BackColor="White" BorderColor="White" BorderStyle="Solid"
                    BorderWidth="1px" CellPadding="1" Font-Names="Verdana" Font-Size="Small"
                    TabIndex="12" Width="800px">
                    <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                    <SelectedItemStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                    <PagerStyle BackColor="White" ForeColor="#330099" HorizontalAlign="Left" Mode="NumericPages"
                        PageButtonCount="9" Position="Top" />
                    <AlternatingItemStyle BackColor="#D7DADF" />
                    <ItemStyle BackColor="#F2F3F5" ForeColor="Black" />
                    <HeaderStyle BackColor="#105BA4" Font-Bold="True" ForeColor="White" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
                    <Columns>
                        <asp:BoundColumn DataField="policy_seq_cd" Visible="False"></asp:BoundColumn>
                        <asp:BoundColumn DataField="payment_seq_cd" Visible="False"></asp:BoundColumn>
                        <asp:BoundColumn DataField="com_pay_seq_cd" HeaderText="com_pay_seq_cd" Visible="False">
                        </asp:BoundColumn>
                        <asp:BoundColumn HeaderText="Due Date" DataField="policy_due_dt" DataFormatString="{0:dd/MM/yyyy}"></asp:BoundColumn>
                        <asp:BoundColumn HeaderText="Policy #" DataField="policy_no"></asp:BoundColumn>
                        <asp:BoundColumn DataField="payment_no" HeaderText="AR #"></asp:BoundColumn>
                        <asp:BoundColumn HeaderText="Introducer" DataField="Name"></asp:BoundColumn>
                        <asp:BoundColumn DataField="provider_desc" HeaderText="Provider" Visible="False"></asp:BoundColumn>
                        <asp:BoundColumn DataField="prdt_desc" HeaderText="Product" Visible="False"></asp:BoundColumn>
                        <asp:BoundColumn HeaderText="Currency" DataField="currency"></asp:BoundColumn>
                        <asp:BoundColumn HeaderText="Policy Amount" DataField="payment_amt" DataFormatString="{0:#,##0.00}"></asp:BoundColumn>
                        <asp:TemplateColumn HeaderText="Rate %" Visible="False">
                            <ItemTemplate>
                                <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server"
                                    FilterType="Numbers" TargetControlID="Rate_txt">
                                </ajaxToolkit:FilteredTextBoxExtender>
                                <asp:TextBox ID="Rate_txt" runat="server" MaxLength="3" Text='<%# Eval("comp_com_rate", "{0:N0}") %>'
                                    Width="30px"></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:BoundColumn HeaderText="Rate %" DataField="comp_com_rate"></asp:BoundColumn>
                        <asp:BoundColumn DataField="Payable" DataFormatString="{0:#,##0.00}" HeaderText="Payable">
                        </asp:BoundColumn>
                        <asp:BoundColumn DataField="com_rec_amt" DataFormatString="{0:#,##0.00}" HeaderText="Receivable">
                        </asp:BoundColumn>
                        <asp:BoundColumn HeaderText="Subtotal" DataField="Subtotal" DataFormatString="{0:#,##0.00}" Visible="False"></asp:BoundColumn>
                        <asp:BoundColumn HeaderText="Balance" DataFormatString="{0:#,##0.00}" Visible="False"></asp:BoundColumn>
                        <asp:BoundColumn DataField="status" HeaderText="Status"></asp:BoundColumn>
                        
                        <asp:TemplateColumn HeaderText="Print" Visible="False">
                            <HeaderStyle Width="15px" />
                            <ItemTemplate>
                                <asp:CheckBox ID="Pay_ch" runat="server" Text=" " />
                            </ItemTemplate>
                            <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                                Font-Underline="False" HorizontalAlign="Center" />
                        </asp:TemplateColumn>
                        <asp:TemplateColumn>
                            <ItemTemplate>
                                <asp:LinkButton ID="Edit_btn" runat="server" CausesValidation="false" CommandName="Edit" Text="Edit" ForeColor="Black"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn Visible="False">
                            <HeaderStyle Width="15px" />
                            <ItemTemplate>
                                <asp:LinkButton ID="Delete_btn" runat="server" CommandName="Delete" ForeColor="Black">Delete</asp:LinkButton>
                                <ajaxToolkit:ConfirmButtonExtender
                                    ID="ConfirmButtonExtender1" runat="server" ConfirmText="Continue delete?" TargetControlID="Delete_btn">
                                </ajaxToolkit:ConfirmButtonExtender>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                                Font-Underline="False" HorizontalAlign="Center" />
                        </asp:TemplateColumn>
                        <asp:TemplateColumn>
                            <ItemTemplate>
                                <asp:LinkButton ID="View_btn" runat="server" CausesValidation="false" CommandName="View"  ForeColor="Black" Text="View"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                    </Columns>
                </asp:DataGrid></td></tr>
        </table>        
    </div>
    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" Mask="99/99/9999"
        MaskType="Date" TargetControlID="Enddate_txt">
    </ajaxToolkit:MaskedEditExtender>
    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server" Mask="99/99/9999"
        MaskType="Date" TargetControlID="Startdate_txt">
    </ajaxToolkit:MaskedEditExtender>
    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server"
        TargetControlID="dtv1">
    </ajaxToolkit:ValidatorCalloutExtender>
    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server"
        TargetControlID="dtv4">
    </ajaxToolkit:ValidatorCalloutExtender>
</asp:Content>
